/**
 * 
 */
package com.ginger.rabbitmq.exchange.api.consumer;

import java.io.IOException;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.AMQP.BasicProperties;

/**
 * @Description: Ginger消费者
 * @author 姜锋
 * @date 2019年3月30日 下午12:14:46 
 * @version V1.0   
 *
 */
public class GingerConsumer extends DefaultConsumer{
	
	
	

	/**
	 * @param channel
	 */
	public GingerConsumer(Channel channel) {
		super(channel);
	}

	/* （非 Javadoc）
	 * @see com.rabbitmq.client.DefaultConsumer#handleDelivery(java.lang.String, com.rabbitmq.client.Envelope, com.rabbitmq.client.AMQP.BasicProperties, byte[])
	 */
	@Override
	public void handleDelivery(String consumerTag, Envelope envelope, BasicProperties properties, byte[] body)
			throws IOException {
		System.out.println("----- consumer message -----");
		System.out.println("consumerTag:"+consumerTag);
		System.out.println("envelope:"+envelope);
		System.out.println("properties:"+properties);
		System.out.println("body:"+new String(body));
		super.handleDelivery(consumerTag, envelope, properties, body);
	}
	
}
